module.exports = (sequelize, Sequelize) => {
    return sequelize.define("chatHistory", {
        id: {
            type: Sequelize.UUID,
            notNull: true,
            primaryKey: true,
            defaultValue: Sequelize.UUIDV4
        },
        username: {
            type: Sequelize.STRING,
            comment: '用户名或聊天室名称',
        },
        roomId: {
            type: Sequelize.STRING,
            comment: '聊天室ID',
            allowNull: true
        },
        isRoom: {
            type: Sequelize.BOOLEAN,
            comment: '是否是群聊',
            defaultValue: false
        },
        lastTime: {
            type: Sequelize.DATE,
            comment: '最后聊天时间',
        }
    }, {
        tableName: 'mg_chat_history'
    });
};